// 新闻文章接口都在这里
import request from '../utils/myaxios'
// 获取文章数据
export const getPostAPI = (params) => {
  return request({
    method:"GET",
    url:'/post',
    params:params,
  })
}
// 文章详情
export const getPosDetatAPI = (id) => {
  return request({
    method:"GET",
    url:`/post/${id}`,
  })
}
// 点赞
export const updatePostLikeByIdAPI = (id) => {
  return request({
      method:'GET',
      url:`/post_like/${id}`,
  })
}
// 收藏文章
export const updatePostStarByIdAPI = (id) => {
  return request({
      method:'GET',
      url:`/post_star/${id}`,
  })
}
// 用户评论列表
export const getUserCommentsIdAPI = () => {
  return request({
      method:'GET',
      url:`/post_comments/`,
  })
}
// 5. 评论列表
export const getPostCommentByIdAPI = (id,params) => {
  return request({
    method: 'GET',
    url: `/post_comment/${id}`,
    params:params,
  })
}
// 发布用户评论
export const pulishPostCommentsIdAPI = (id,data) => {
  return request({
      method:'POST',
      url:`/post_comment/${id}`,
      data,
  })
}
// 2. 搜索文章
export const getPostSearchAPI = (params) => {
  return request({
    method: 'GET',
    url: '/post_search',
    params,
  })
}